package com.itheima.demo07;

public class IntegerCase {
    public static void main(String[] args) {
        String str = "11 12 13 14 15";

        //定义一个字符串和整数类型的数组
        String[] strings = str.split(" ");
        int[] num = new int[strings.length];

        //循环遍历字符串数组，将其转换成int类型
        for (int i = 0; i < strings.length; i++) {
            int number = Integer.parseInt(strings[i]);
            num[i] = number;
        }

        //遍历存储到int数组中的数据
        for (int i = 0; i < num.length; i++) {
            System.out.println(num[i]);
        }
    }
}
